package com.mathdroid.gui.main.filter;

/**
 * This is an element of the filter-JList model in the filter panel.
 */
public final class FilterElement {
	
	/**
	 * The name of the source filter.
	 */
	private String source = null;
	
	/**
	 * If the filter is enabled.
	 */
	private Boolean enabled = true;
	
	/**
	 * The icon name of the filter.
	 */
	private String icon = null;
	
	/**
	 * Create a new filter model element.
	 * @param s Name of the source.
	 * @param b If the filter is enabled.
	 * @param i The name of the icon.
	 */
	public FilterElement(final String s, final Boolean b, final String i) {
		this.source = s;
		this.enabled = b;
		this.icon = i;
	}
	
	@Override
	public String toString() {
		return this.source;
	}
	
	/**
	 * If the filter is enabled.
	 * @return If the filter is enabled.
	 */
	public boolean isEnabled() {
		return this.enabled;
	}
	
	/**
	 * Set if the filter is enabled.
	 * @param b If the filter is enabled.
	 */
	public void setEnabled(final boolean b) {
		this.enabled = b;
	}

	/**
	 * Get the icon name of the source.
	 * @return The icon name of the source.
	 */
	public String getIcon() {
		return this.icon;
	}
}
